;; 
;; @file   le-emacs-yasnippet.el 
;; @date   2011/10/28
;; @update 2011/12/23
;; @usage 
;; @in     EMACS-DIR, a path string of emacs directory that contains le_plugins/
;;         and le_emacs_conf/
;; @See    http://yasnippet.googlecode.com/svn/trunk/doc/index.html       
;;
;;
;; [INSTALL Yasnippet]
;;       (1) Download : yasnippet-0.6.1c.tar.bz2
;;       (2) Unpack and put Yasnippet/ to load path. 
;;       (3) set yas/root-directory variable to "*/Yasnippet/snippets/"
;; [CONFIG NOTES]
;;       (1) Minor mode yas/minor-mode must be actived. 
;;       (2) variable:  yas/trigger-key defines the trigger key(DEFAULT to TAB)
;;       (3) function:  yas/insert-snippet create a new file for writting a new
;;                      snippet for curret major mode. 
;;       (4) yas/trigger-key invokes yas/expand, which tries to expand a snippet
;;       (5) variable: yas/fallback-behaviour is a customization variable
;;           bound to 'call-other-command by default.
;;           If yas/expand failed to find any suitable snippet to expand,
;;           it will find if there's any other cmd bound the yas/trigger-key.
;;       (6) Call 'yas/expand-snippet' in Elisp code instead of 'yas/expand'
;;

(defvar YAS_DIR (concat EMACS_DIR "le_plugins/yasnippet-0.6.1c"))
(defvar YAS_SNIPPETS (concat EMACS_DIR "le_plugins/yasnippet-0.6.1c/snippets"))

;(setq YAS_DIR "D:/Program Files/emacs-23.3/le_plugins/yasnippet-0.6.1c")
;(setq YAS_SNIPPETS
;      "D:/Program Files/emacs-23.3/le_plugins/yasnippet-0.6.1c/snippets")    

(add-to-list 'load-path YAS_DIR)
(require 'yasnippet)
(require 'dropdown-list)
(yas/initialize)
;; Develop and keep personal snippets under ~/emacs.d/mysnippets
(setq yas/root-directory YAS_SNIPPETS)
;; Load the snippets
(yas/load-directory yas/root-directory)
;; When there are multiple candidates, YASnippet will let you select one.
;; The UI for selecting multiple candidate can be customized through
;; yas/prompt-functions.
;; When using yas/dropdown-prompt, you can use C-n, C-p to navigate, q to quit.
;; and even press 6 as a shortcut to select the 6th candidate.
;; NOTE:
;;   yas/dropdown-promp require dropdown-list
;;   yas/ido-promt require ido-mode
(setq yas/prompt-functions '(yas/dropdown-prompt
                             yas/ido-prompt
                             yas/x-prompt))

;(global-set-key [S-f3] 'yas/new-snippet)








